<template>
    <div>
    <!-- 通过 {{name}}访问到state对象的那么属性值 -->
      <h1>mapState</h1>
      <p>{{msg}}</p>
      <p>{{count}}</p>
    </div>
</template>

<script>
  import { mapState } from 'vuex'
  export default {
    computed: {
      ...mapState([
        'count', // 将this.count映射至this.$store.state.count
        'msg'  // 将this.name映射至this.$store.state.name
      ]),
    }
  }
</script>

